package com.kakaxi.mybilibili.viewholder;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.kakaxi.mybilibili.R;

/**
 * 番剧标题视图持久化类
 * Created by kakaxi on 16/10/20.
 */

public class DramaTitleViewHolder extends RecyclerView.ViewHolder {

    /** 图标图片控件 **/
    public ImageView iconImg;

    /** 名称文本控件 **/
    public TextView nameTxt;

    /** 更多文本控件 **/
    public TextView moreTxt;

    public DramaTitleViewHolder(View itemView) {
        super(itemView);
        iconImg = (ImageView) itemView.findViewById(R.id.img_drama_title_icon);
        nameTxt = (TextView) itemView.findViewById(R.id.txt_drama_title_name);
        moreTxt = (TextView) itemView.findViewById(R.id.txt_drama_title_more);
    }

    public void setData(String nameStr, String moreStr) {
        nameTxt.setText(nameStr);
        if (moreStr == null) {
            moreTxt.setVisibility(View.INVISIBLE);
        } else {
            moreTxt.setText(moreStr + ">");
        }
    }

}
